app.controller('vipDevicePageCtrl',function($scope,$state,PopupService,$stateParams,$http,$myconfig,$timeout,$ionicConfig){

    $scope.user_device = JSON.parse(localStorage.getItem('user'));
// console.log($scope.user_device);
    $scope.deviceList = function(){
        $http.get($myconfig.api.base_host + '/users/user_mydevice?user_id=' + $scope.user_device.id)
        .then(function(res){
            // console.log(res.data.data);
            $scope.Mydevice = res.data.data;
        });
    };

    $scope.openBaidu = function(){
        cordova.InAppBrowser.open('http://baidu.com','_system', 'location=no,toolbar=yes,toolbarposition=top,closebuttoncaption=关闭');
        // window.open('http://baidu.com', '_system', 'location=yes');
    };



    if($scope.user_device){
        $scope.deviceList();
    }
    $scope.$on('$ionicView.enter', function(){

        $ionicConfig.views.swipeBackEnabled(false);

    });
});
